Skip to content

Add a Cucumber JVM 8 adapter - #1455

Merged
baev merged 5 commits into
allure-framework:mainfrom
MohabMohie:cucumber-8-adapter
Nov 3, 2026
Merged

baev merged 5 commits into
allure-framework:mainfrom
MohabMohie:cucumber-8-adapter

Conversation

@MohabMohie

Copy link
Copy Markdown
Contributor

What

Adds allure-cucumber8-jvm, a Cucumber JVM 8 plugin that mirrors allure-cucumber7-jvm and runs on Cucumber 8.0.4.

Cucumber 8 messages type Location.line as a Java int. This module stores lines in Map<Integer, AstNode> and calls int getLine(). Bytecode compiled against the cucumber 7 Long getLine() descriptor throws NoSuchMethodError on this runtime.

Cucumber 8 reports a failed @BeforeAll or @AfterAll hook on the TestRunHookFinished message. TestRunFinished has no throwable for that hook, and Runtime.run() returns. The adapter writes the same run-level global error the cucumber 7 adapter writes when the plugin result carries the throwable.

The suite also records @flaky, @muted, and @known on the scenario result.

Coverage

A real Cucumber JVM 8.0.4 run asserts feature source through the title path and descriptions, scenario name, uri:line full name, example-row parameters, step keyword and text with status, data-table CSV attachment, before/after hooks as fixtures, other hooks as steps, write and embed attachments, tag labels, issue and TMS links, flaky/muted/known, undefined step text Undefined Step. Please add step definition, pending, ambiguous, and a run-level global error when @BeforeAll fails before any scenario.

Tracker

Requested by #1451. This pull request does not close that issue.

The adapter mirrors allure-cucumber7-jvm and reads Gherkin lines as ints from messages v34. Cucumber 8 reports failed @BeforeAll and @afterall hooks on TestRunHookFinished, so those failures are stored as run-level global errors. Status tags mark flaky, muted, and known results.
The install command compiles allure-cucumber8-jvm against Allure Java 3.0.0 and skips signing so a commit build can be resolved before the upstream release.
@CLAassistant

CLAassistant commented Oct 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

MohabMohie added a commit to ShaftHQ/SHAFT_ENGINE that referenced this pull request Oct 12, 2026
Fixes #6262

SHAFT now runs Cucumber 8.0.4 and reports through
`io.qameta.allure.cucumber8jvm.AllureCucumber8Jvm`. The adapter sources
are the Cucumber 8 port from
allure-framework/allure-java#1455 at commit
`a1df39fffb1389ecbce951d617b5da3c49bb1a3a`, compiled into
`shaft-engine`. Listeners extend that class. The published
`shaft-engine` jar carries the classes, so consumers resolve
shaft-engine from Maven Central and do not need another repository.

A JitPack repository is not used. JitPack also serves
`com.github.docker-java:docker-java:3.7.1`, and that POM depends on
`com.github.docker-java.docker-java` transports, including the test-kit
that brings `junit:junit:4.12`.

SHAFT still depends on `cucumber-java`, `cucumber-testng`, and
`cucumber-picocontainer` directly, so the cucumber-bom 8.0.4 import
supplies them. `CucumberFeatureListener` and
`CucumberTestRunnerListener` extend `AllureCucumber8Jvm`. The JSON
cucumber plugin path stays `json:allure-results/cucumber.json`.
Dependabot no longer ignores `io.cucumber:cucumber-bom` semver-major
updates.

Upstream request remains
allure-framework/allure-java#1451. This pull
request does not close that issue.

## Riskiest assumption

The adapter sources compiled into `shaft-engine` are the Cucumber 8
listener from allure-java commit
`a1df39fffb1389ecbce951d617b5da3c49bb1a3a`.
`CucumberFeatureListenerUnitTest` asserts that `AllureCucumber8Jvm`
loads from `shaft-engine`, and
`CucumberTestsHelperCoverageUnitTest.configureCucumberPropertiesShouldPopulateAllExpectedParameters`
still sees `json:allure-results/cucumber.json`.

## Evidence

- Focused shaft-engine tests passed after the adapter moved in-tree:
Tests run: 15, Failures: 0, Errors: 0.
- The overlay test still reads the scenario name and last-step health
through the shipped listener.
- The TestNG Cucumber runner listener tests still pass.
- The shipped cucumber plugin string still contains
`json:allure-results/cucumber.json`.
@MohabMohie

Copy link
Copy Markdown
Contributor Author

@baev appreciate your review and feedback :)

@MohabMohie

Copy link
Copy Markdown
Contributor Author

@andrcuns appreciate your feedback if applicable

Comment thread jitpack.yml Resolved

@baev baev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. Please remove the jitpack.yml

@anilreddy

Copy link
Copy Markdown

@MohabMohie can you please complete the changes we need this to be merged... waiting for it..

@baev baev added the pr:new feature Change that add something new for end users label Oct 22, 2026
@anilreddy anilreddy mentioned this pull request Oct 24, 2026
2 tasks done
Bring in global-error status enrichment (allure-framework#1454) and dependency bumps so the Cucumber 8 adapter tracks current main.
Rebuild GlobalError failures from the Cucumber messages exception so
@BeforeAll/@afterall keep their original type and stack frames, align
run-level errors with the status-aware createGlobalError overload, and
remove the temporary jitpack.yml publish helper.
@MohabMohie

MohabMohie commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Done — jitpack.yml is removed in the latest push. Also addressed the @BeforeAll / @AfterAll exception-preservation comment on the same review pass.

@anilreddy @baev kindly check now and advise.

@MohabMohie

Copy link
Copy Markdown
Contributor Author

@baev @andrcuns appreciate your feedback to merge this PR please.

@baev
baev merged commit 3fcd762 into allure-framework:main Nov 3, 2026
5 checks passed
@baev

baev commented Nov 3, 2026

Copy link
Copy Markdown
Member

@MohabMohie thanks

@emaks

emaks commented Nov 4, 2026

Copy link
Copy Markdown

@baev Do we have an ETA for the release of these changes?

@anilreddy

Copy link
Copy Markdown

It is already merged and 3.1.0 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new feature Change that add something new for end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants